import xml.Message;
import dd.control.AddChoiceResponseController;
import dd.control.AddEdgeResponseController;
import dd.control.AdminResponseController;
import dd.control.ConnectController;
import dd.control.EventsResponseController;
import dd.control.ReportResponseController;
import dd.control.TurnResponseController;
import dd.control.modCreateResponseController;
import dd.control.userSignInResponseController;

public class AnotherHandler extends HandlerBase {

	/**
	 * this handler handle all the response get from server
	 */
	@Override
	public void process(Message response) {
		String type = response.contents.getFirstChild().getLocalName();

		System.out.println("AnotherHandler process(): Client received response type is :" + type);
		System.out.println("=========+==========");

		if (type.equals("connectResponse")) {
			// What happens now that we are connected?
			new ConnectController().process(response);
		} else if (type.equals("signInResponse")) {
			new userSignInResponseController().process(response);
		} else if (type.equals("createResponse")) {
			new modCreateResponseController().process(response);
		} else if (type.equals("addChoiceResponse")) {
			new AddChoiceResponseController().process(response);
		} else if (type.equals("addEdgeResponse")) {
			new AddEdgeResponseController().process(response);
		} else if (type.equals("turnResponse")) {
			new TurnResponseController().process(response);
		} else if (type.equals("reportResponse")) {
			new ReportResponseController().process(response);
		} else if (type.equals("eventsResponse")) {
			new EventsResponseController().process(response);
		} else if (type.equals("adminResponse")) {
			new AdminResponseController().process(response);
		}
		// System.out.println("Really received:" + response);

		// continue on to the next one in the chain, as based on superclass behavior
		super.process(response);
	}

}
